from typing import Union, List

import numpy as np


def mcc_rule(state: Union[np.ndarray, None], act: Union[int, np.ndarray]):
    if state is None:
        return act, None, False

    if type(act) != int:
        if state[0] > 0 and state[1] > 0:
            act = 1
        elif state[0] < 0 and state[1] < 0:
            act = -1
    return act, None, False
